package com.langchain4j.tool;

import dev.langchain4j.agent.tool.P;
import dev.langchain4j.agent.tool.Tool;
import dev.langchain4j.agent.tool.ToolMemoryId;

public class CalcTool {

    @Tool(name = "sum",value = "加法运算")
    public double calc(@ToolMemoryId int userId,
                       @P(value = "加数1", required = true) double a,
                       @P(value = "加数2", required = true) double b){
        System.out.println("ai 调用工具userId="+userId+"了：a="+b+",b="+b);
        return a + b;
    }
}
